package com.xianggu.designMode.combination.demo01;

/**
 * @author chengjy
 * @date 2025/3/15
 */
public class MenuItem extends MenuComponent{

    public MenuItem(String name, int level) {
        this.name = name;
        this.level = level;
    }
    @Override
    public void print() {
        for (int i = level; i > 0; i--) {
            System.out.print(" ");
        }
        System.out.println("-" +getName());
    }

}
